import React from 'react'
import {
    Table
} from '@devexpress/dx-react-grid-material-ui';
const CustomCell = ({ value, style }) => (
    <Table.Cell
        style={{
            backgroundColor: value < 5000 ? 'red' : undefined,
            ...style,
        }}
    >
    <span
        style={{
            color: value < 5000 ? 'white' : undefined,
        }}
    >
      {value}
    </span>
    </Table.Cell>
);

const ThemeCell = (props) => {
    const { column } = props;
    if (column.name === 'amount') {
        return <CustomCell {...props} />;
    }
    return <Table.Cell {...props} />;
};

export default ThemeCell